package com.cn.icss.validator;

import live.autu.plugin.jfinal.swagger.annotation.ApiImplicitParam;
import org.apache.commons.lang3.StringUtils;

import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;

/**
 * @中软华腾软件系统有限公司,未经授权不得擅自传播
 * @类描述: 评论验证
 * @类名称:StreamValidator
 * @作者: Administrator
 * @编辑时间: 2020/04/08 19:12
 * @版本: 1.0
 */
public class RewardValidator extends BaseValidator {

    @Override
    protected void validate(Controller c) {
        setRet(Ret.fail());// 官网推荐
        // 判断写各个方法的验证
        switch (super.getActionMethodName()) {
            case "exceptional":{
                super.validateRequired("targetId", "comment_targetId_msg","打赏对象不能为空");
                super.validateRequired("userId", "comment_userId_msg","打赏人Id不能为空");
                super.validateRequired("userName", "comment_userName_msg", "打赏人名称不能为空");
                super.validateRequired("giftId", "comment_userName_msg","打赏礼物不能为空");
                break;
            }
            case "findExceptionalGift": {
                super.validateRequired("targetId", "comment_targetId_msg","接收打赏对象Id不能为空");
                break;
            }
            default: {

            }
        }

    }

}
